namespace MvvmFx.Common.ViewModels.Factories
{
    /// <summary>
    /// Creates and returns a <see cref="IViewModelFactory{T}"/> object with data from the model.
    /// </summary>
    /// <remarks>
    /// An <see cref="ViewModelBase"/> abstracts and encapsulates the logic for
    /// creating and loading a <see cref="ICreateCriteria"/> object and hydrating it with
    /// data from the model.
    /// The overloaded Create method can take an <see cref="ViewModelBase"/> object
    /// to specify context-specific data about which model objects to load from.
    /// </remarks>
    public interface IViewModelFactory<T> where T : ViewModelBase
    {
        /// <summary>
        /// Creates and returns a ViewModel object with data from the model.
        /// </summary>
        T Create();

        /// <summary>
        /// Creates and returns a <see cref="ViewModelBase"/> object with data from the model,
        /// using the <see cref="ICreateCriteria"/> to find it
        /// </summary>
        T Create(ICreateCriteria criteria);
    }
}